import Vue from 'vue'
import Router from 'vue-router'

import home from '@/pages/home'
import box from '@/pages/box'

// 新闻详情
import newsDetails from '@/pages/newsDetails'

// 定制优势
import customized from '@/pages/exam/customized'
// 天赋测试
import talent from '@/pages/exam/talent'
// 开始测试
import examStart from '@/pages/exam/examStart'
// 结果生成中
import examResulting from '@/pages/exam/examResulting'
// 测试结果
import examResult from '@/pages/exam/examResult'
// 孩子测试结果
import examResultChild from '@/pages/exam/examResultChild'

// 课程分类
import classify from '@/pages/course/classify'
// 课程列表
import courseList from '@/pages/course/courseList'
// 视频详情
import courseDetails from '@/pages/course/courseDetails'
// 音频详情
import audioDetails from '@/pages/course/audioDetails'
// 讲师详情
import lecturerInfo from '@/pages/course/lecturerInfo'
// 确认订单
import confirmOrder from '@/pages/course/confirmOrder'
// 支付成功
import paySuccess from '@/pages/course/paySuccess'

// 公益
// 公益首页
import publicWelfare from '@/pages/welfare/publicWelfare'
// 公益项目
import welfarePro from '@/pages/welfare/welfarePro'
// 公益项目列表
import welfareProList from '@/pages/welfare/welfareProList'
// 公益公示
import welfareNotice from '@/pages/welfare/welfareNotice'
// 项目捐款记录
import contribuList from '@/pages/welfare/contribuList'
// 捐款协议
import donationAgreement from '@/pages/welfare/donationAgreement'
// 捐款成功
import welfareSuccess from '@/pages/welfare/welfareSuccess'
// 我的捐款
import myWelfare from '@/pages/welfare/myWelfare'
// 捐款明细
import welfareList from '@/pages/welfare/welfareList'
// 公益新闻列表
import welfareNewsList from '@/pages/welfare/welfareNewsList'

// 商城
// 商城首页
import goods from '@/pages/goods/goods'
// 商城详情
import goodsDetails from '@/pages/goods/goodsDetails'
// 商城确认订单
import goodsConfirmOrder from '@/pages/goods/goodsConfirmOrder'
// 购物车
import cart from '@/pages/goods/cart'
// 商城订单
import goodsOrder from '@/pages/goods/goodsOrder'
// 订单详情
import goodsOrderDetails from '@/pages/goods/goodsOrderDetails'

// 线下门店
// 线下门店
import offLine from '@/pages/offline/offLine'
// 搜索门店
import searchStore from '@/pages/offline/searchStore'
// 门店详情
import storeDetails from '@/pages/offline/storeDetails'

// 个人中心
// 我的
import personal from '@/pages/person/personal'
// 编辑
import edit from '@/pages/person/edit'
// 密钥管理
import keyManagement from '@/pages/person/keyManagement'
// 密钥激活
import addKey from '@/pages/person/addKey'
// 测试结果
import myExam from '@/pages/person/myExam'
// 绑定手机号
import bindPhone from '@/pages/person/bindPhone'
// 购买的课程
import myCourse from '@/pages/person/myCourse'
// 课程收藏
import courseCollect from '@/pages/person/courseCollect'
// 课程购买记录
import purchaseRecord from '@/pages/person/purchaseRecord'
// 我的门店
import myStore from '@/pages/person/myStore'
// 我的学习
import myStudy from '@/pages/person/myStudy'
// 我的培训
import myTrain from '@/pages/person/myTrain'
// 分享
import share from '@/pages/person/share'
// 关于我们
import about from '@/pages/person/about'
// 方案定制
import planMake from '@/pages/person/planMake'
// 选择属性
import editAttr from '@/pages/person/editAttr'
// 方案定制详情
import makeAudioDetails from '@/pages/person/makeAudioDetails'
// 方案定制详情
import makeVideoDetails from '@/pages/person/makeVideoDetails'



Vue.use(Router)

export default new Router({
  // mode: 'history',
  routes: [{
    path: '/',
    component: box,
    children: [{
      path: '/',
      meta: {
        title: '智慧宝'
      },
      component: home
    }, {
      path: '/publicWelfare',
      meta: {
        title: '公益'
      },
      component: publicWelfare
    }, {
      path: '/goods',
      meta: {
        title: '商城'
      },
      component: goods
    }, {
      path: '/offLine',
      meta: {
        title: '天赋线下门店'
      },
      component: offLine
    }, {
      path: '/personal',
      meta: {
        title: '我的'
      },
      component: personal,
    }]
  }, {
    path: '/news',
    meta: {
      title: '新闻详情'
    },
    component: newsDetails,
  }, {
    path: '/customized',
    meta: {
      title: '定制优势'
    },
    component: customized,
  }, {
    path: '/talent',
    meta: {
      title: '天赋测试'
    },
    component: talent,
  }, {
    path: '/examStart',
    meta: {
      title: '开始测试'
    },
    component: examStart,
  }, {
    path: '/examResulting',
    meta: {
      title: '结果生成中'
    },
    component: examResulting,
  }, {
    path: '/examResult',
    meta: {
      title: '测试结果'
    },
    component: examResult,
  }, {
    path: '/examResultChild',
    meta: {
      title: '测试结果'
    },
    component: examResultChild,
  }, {
    path: '/classify',
    meta: {
      title: '分类'
    },
    component: classify,
  }, {
    path: '/courseList',
    meta: {
      title: '课程列表'
    },
    component: courseList,
  }, {
    path: '/courseDetails',
    meta: {
      title: '视频详情'
    },
    component: courseDetails,
  }, {
    path: '/audioDetails',
    meta: {
      title: '音频详情'
    },
    component: audioDetails,
  }, {
    path: '/confirmOrder',
    meta: {
      title: '确认订单'
    },
    component: confirmOrder,
  }, {
    path: '/lecturerInfo',
    meta: {
      title: '讲师详情'
    },
    component: lecturerInfo,
  }, {
    path: '/paySuccess',
    meta: {
      title: '提示'
    },
    component: paySuccess,
  }, {
    path: '/welfarePro',
    meta: {
      title: '公益项目'
    },
    component: welfarePro,
  }, {
    path: '/welfareProList',
    meta: {
      title: '公益项目列表'
    },
    component: welfareProList,
  }, {
    path: '/welfareNotice',
    meta: {
      title: '公益公示'
    },
    component: welfareNotice,
  }, {
    path: '/welfareNotice',
    meta: {
      title: '公益公示'
    },
    component: welfareNotice,
  }, {
    path: '/contribuList',
    meta: {
      title: '项目捐款记录'
    },
    component: contribuList,
  }, {
    path: '/donationAgreement',
    meta: {
      title: '捐款协议'
    },
    component: donationAgreement,
  }, {
    path: '/welfareSuccess',
    meta: {
      title: '提示'
    },
    component: welfareSuccess,
  }, {
    path: '/myWelfare',
    meta: {
      title: '我的捐赠'
    },
    component: myWelfare,
  }, {
    path: '/welfareList',
    meta: {
      title: '捐赠明细'
    },
    component: welfareList,
  }, {
    path: '/welfareNewsList',
    meta: {
      title: '公益新闻列表'
    },
    component: welfareNewsList,
  }, {
    path: '/goodsDetails',
    meta: {
      title: '商品详情'
    },
    component: goodsDetails,
  }, {
    path: '/goodsConfirmOrder',
    meta: {
      title: '确认订单'
    },
    component: goodsConfirmOrder,
  }, {
    path: '/cart',
    meta: {
      title: '购物车'
    },
    component: cart,
  }, {
    path: '/goodsOrder',
    meta: {
      title: '商城订单'
    },
    component: goodsOrder,
  }, {
    path: '/goodsOrderDetails',
    meta: {
      title: '商城订单'
    },
    component: goodsOrderDetails,
  }, {
    path: '/searchStore',
    meta: {
      title: '搜索门店'
    },
    component: searchStore,
  }, {
    path: '/storeDetails',
    meta: {
      title: '门店详情'
    },
    component: storeDetails,
  }, {
    path: '/edit',
    meta: {
      title: '编辑资料'
    },
    component: edit,
  }, {
    path: '/keyManagement',
    meta: {
      title: '密钥管理'
    },
    component: keyManagement,
  }, {
    path: '/addKey',
    meta: {
      title: '密钥激活'
    },
    component: addKey,
  }, {
    path: '/myExam',
    meta: {
      title: '测试结果'
    },
    component: myExam,
  }, {
    path: '/bindPhone',
    meta: {
      title: '绑定手机号'
    },
    component: bindPhone,
  }, {
    path: '/myCourse',
    meta: {
      title: '购买的课程'
    },
    component: myCourse,
  }, {
    path: '/courseCollect',
    meta: {
      title: '课程收藏'
    },
    component: courseCollect,
  }, {
    path: '/purchaseRecord',
    meta: {
      title: '课程购买记录'
    },
    component: purchaseRecord,
  }, {
    path: '/myStore',
    meta: {
      title: '我的门店'
    },
    component: myStore,
  }, {
    path: '/myStudy',
    meta: {
      title: '我的学习'
    },
    component: myStudy,
  }, {
    path: '/myTrain',
    meta: {
      title: '我的培训'
    },
    component: myTrain,
  }, {
    path: '/share',
    meta: {
      title: '分享给好友'
    },
    component: share,
  }, {
    path: '/about',
    meta: {
      title: '智慧宝'
    },
    component: about,
  }, {
    path: '/planMake',
    meta: {
      title: '方案定制'
    },
    component: planMake,
  }, {
    path: '/editAttr',
    meta: {
      title: '选择属性'
    },
    component: editAttr,
  }, {
    path: '/makeAudioDetails',
    meta: {
      title: '方案定制详情'
    },
    component: makeAudioDetails,
  }, {
    path: '/makeVideoDetails',
    meta: {
      title: '方案定制详情'
    },
    component: makeVideoDetails,
  }],
  scrollBehavior(to, from, savedPosition) {
    return {
      x: 0,
      y: 0
    }
  }
})